
import Person from './person.js';
class Teacher extends Person {
    constructor(id,name,age,klasses){
        super(id,name,age);
        this.klasses=klasses;
    }
    introduce(){
        let result=super.introduce();
        if(this.klasses===undefined)
            result+=` I am a Teacher. I teach No Class.`;
        else
            {
                if(this.klasses.length==1)
                    result+=` I am a Teacher. I teach Class ${this.klasses.number}.`;
                else
                    result+=` I am a Teacher. I teach Class ${this.klasses[0].number}, ${this.klasses[1].number}.`;
            }
        return result;
    }
}
export default Teacher;

